import _thread
import checkNet
from usr.dtu import Dtu

_thread.stack_size(4096)


def create_dtu():
    while checkNet.waitNetworkReady() == (3, 1):
        break

    dtu = Dtu('DTU')

    dtu.config.read_from_json('/usr/dtu_config.json')

    return dtu


if __name__ == '__main__':
    dtu = create_dtu()
    dtu.run()
